<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script src="../ExternalJs/jquery-2.2.4.min.js" type="text/javascript"></script>

    <meta name="viewport" content="initial-scale=0.4, maximum-scale=0.4， minimum-scale=0.4, width=device-width, user-scalable=no">

    <!--<script>-->
        <!--$("document").ready(function(){-->
            <!--var width = window.screen.width-->
            <!--if(width>376){-->
                <!--$("head").append('<meta name="viewport" content="initial-scale=0.4, maximum-scale=0.4， minimum-scale=0.4, width=device-width, user-scalable=no">');-->
            <!--}else if(width<350){-->
                <!--$("head").append('<meta name="viewport" content="initial-scale=0.3, maximum-scale=0.3， minimum-scale=0.3, width=device-width, user-scalable=no">');-->
            <!--}else{-->
                <!--$("head").append('<meta name="viewport" content="initial-scale=0.35, maximum-scale=0.35， minimum-scale=0.35, width=device-width, user-scalable=no">');-->
            <!--}-->
        <!--});-->
    <!--</script>-->
</head>
<style>
    .test{
        background: #E6E6E6;
       padding:100px;
    }
</style>
<body>
<span class="test">+</span>
<script>
    var timeout ;
    var Interval ;
    var consultTime =0;
    $(".test").mousedown(function(e){
        timeout = setTimeout(function() {
            Interval =  setInterval(function clock(){
                consultTime++;
                console.log(consultTime);
            },150);
        }, 400);
        e.stopPropagation();
    })
    $(".test").mouseup(function(){
        timeout = clearTimeout(timeout);
        Interval = clearInterval(Interval);
    })
    $(".test").on({
        touchstart: function(e){
            timeOutEvent = setTimeout(function() {
                Interval =  setInterval(function clock(){
                    consultTime++;
                    console.log(consultTime);
                },150);
            }, 400);
            e.preventDefault();
        },
        touchend: function(){
            clearTimeout(timeOutEvent);
            if(timeOutEvent!=0){
                clearTimeout(timeOutEvent);
                clearInterval(Interval);
            }
            return false;
        }
    })
</script>



</body>
</html>